import request from '@/utils/request'

// 查询供应商信息列表
export function listSuppliers(query) {
  return request({
    url: '/suppliers/suppliers/list',
    method: 'get',
    params: query
  })
}

// 查询供应商信息列表(不分页)
export function findSuppliers() {
  return request({
    url: '/suppliers/suppliers/selectAll',
    method: 'post'
  })
}

// 查询供应商信息详细
export function getSuppliers(supplierId) {
  return request({
    url: '/suppliers/suppliers/' + supplierId,
    method: 'get',

  })
}

// 新增供应商信息
export function addSuppliers(data) {
  return request({
    url: '/suppliers/suppliers',
    method: 'post',
    data: data
  })
}


// 修改供应商信息
export function updateSuppliers(data) {
  return request({
    url: '/suppliers/suppliers',
    method: 'put',
    data: data
  })
}

// 查询货品信息详细
export function getProduct(supplierId) {
  return request({
    url: '/suppliers/suppliers' + supplierId,
    method: 'get'
  })
}

// 删除供应商信息
export function delSuppliers(supplierIds) {
  return request({
    url: '/suppliers/suppliers/' + supplierIds,
    method: 'delete'
  })
}
// 获取编码
export function getCode(code) {
  return request({
    url: '/suppliers/suppliers/getcode?code=' + code,
    method: 'post'
  })
}
// 查询详情
export function selectPysuppliers(supplierId) {
  return request({
    url: '/suppliers/suppliers/selectPysuppliers?supplierId='+supplierId,
    method: 'get'
  })
}

// // 查询详情
// export function selectpysuppliersDetails(supplierId) {
//   return request({
//     url: '/product/product/selectpysuppliersDetails?supplierId='+supplierId,
//     method: 'get'
//   })
// }

